import request from '@/utils/request'

// 获取列表
export function listTemplate(query) {
  return request({
    url: '/system/admin/photos',
    method: 'get',
    params: query
  })
}

// 新增
export function addTemplate(data) {
  return request({
    url: '/system/admin/photos',
    method: 'post',
    data: data
  })
}

// 修改
export function updateTemplate(data) {
  return request({
    url: `/system/admin/photos/${data.uuid}`,
    method: 'put',
    data: data
  })
}

// 修改状态
export function updateTemplateStatus(data) {
  return request({
    url: `/system/admin/photos/${data.uuid}/updateStatus`,
    method: 'put',
    data: data
  })
}

// 删除
export function delTemplate(uuid) {
  return request({
    url: `/system/admin/photos/${uuid}`,
    method: 'delete'
  })
}

// 详情
export function getTemplate(uuid) {
  return request({
    url: `/system/photos/${uuid}`,
    method: 'get'
  })
}

// 导出列表
export function listTemplateExport(query) {
  return request({
    url: '/system/admin/photos/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
